<?php

/*
	[Question&Answer] (C)2011-2099 .

	$Id: admin.php 2011-11-21 10:15:10Z JS $
*/

error_reporting(E_ALL);
@set_magic_quotes_runtime(0);

$mtime = explode(' ', microtime());
$starttime = $mtime[1] + $mtime[0];

define('IN_QA', 'admin');
define('QA_ROOT', substr(__FILE__, 0, -9));


unset($GLOBALS, $_ENV, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_ENV_VARS);
require QA_ROOT.'release/release.php';
require QA_ROOT.'config/init.cfg.php';
$_GET		= coreFun::daddslashes($_GET, 1, TRUE);
$_POST		= coreFun::daddslashes($_POST, 1, TRUE);
$_COOKIE	= coreFun::daddslashes($_COOKIE, 1, TRUE);
$_SERVER	= coreFun::daddslashes($_SERVER);
$_FILES		= coreFun::daddslashes($_FILES);
$_REQUEST	= coreFun::daddslashes($_REQUEST, 1, TRUE);


require QA_ROOT.'model/base.php';
require QA_ROOT.'model/admin.php';

$c = coreFun::getgpc('c');
$a = coreFun::getgpc('a');
$c = empty($c) ? 'frame' : $c;
$a = empty($a) ? 'index' : $a;
//补丁目录
define('RELEASE_ROOT', '');

if(in_array($c, array('admin', 'app','cache', 'db', 'domain', 'frame', 'log', 'note', 'feed', 'mail', 'setting', 'user', 'credit', 'seccode', 'tool', 'plugin'))) {
	include QA_ROOT."control/".IN_QA."/$c.php";
	$control = new control();
	$method = 'on'.$a;
	if(method_exists($control, $method) && $a{0} != '_') {
		$control->$method();
	} elseif(method_exists($control, '_call')) {
		$control->_call('on'.$a, '');
	} else {
		exit('Action not found!');
	}
} else {
	exit('Control not found!');
}

/**
$mtime = explode(' ', microtime());
	$endtime = $mtime[1] + $mtime[0];
	echo '<script>document.getElementById(\'debug_time\').innerHTML = \''.number_format($endtime - $starttime, 5).'\'</script>'."\n";
*/


?>